﻿Imports DevExpress.XtraEditors
Imports System
Imports System.ComponentModel
Imports System.Windows.Forms

Namespace IControls
    Public Class ICheckEdit
        Inherits CheckEdit
        ' Methods
        Public Sub New()
            Me.InitializeComponent()
            Me.EditValue = Nothing
        End Sub

        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            If (disposing AndAlso (Not Me.components Is Nothing)) Then
                Me.components.Dispose()
            End If
            MyBase.Dispose(disposing)
        End Sub

        Protected Sub FindNextControl(ByVal parent As Control)
            If parent.HasChildren Then
                Dim control As Control
                For Each control In parent.Controls
                    If (control.TabIndex = (MyBase.TabIndex + 1)) Then
                        control.Focus()
                        Exit For
                    End If
                    Me.FindNextControl(control)
                Next
            End If
        End Sub

        Private Sub InitializeComponent()
            Me.fProperties = New DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit()
            CType(Me.fProperties, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'fProperties
            '
            Me.fProperties.Name = "fProperties"
            '
            'ICheckEdit
            '
            Me.EnterMoveNextControl = True
            CType(Me.fProperties, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub

        Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs)
            MyBase.OnKeyDown(e)
            If (e.KeyCode = Keys.Return) Then
                Dim parent As Form = MyBase.FindForm
                If (Not parent Is Nothing) Then
                    Me.FindNextControl(parent)
                End If
            End If
        End Sub

        Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
            MyBase.OnPaint(pe)
        End Sub



        ' Fields
        Private components As IContainer
    End Class
End Namespace

